iT邦幫忙

2025 iThome 鐵人賽

DAY 1
0

tf.cast()

tf.cast(x, dtype, name=None)

參數介紹:

  1. x:帶轉換的數據(張量)。
  2. dtype:目標數據類型。
  3. name:可選參數,定義操作的名稱。
    把int32的資料型別轉換成float32
    https://ithelp.ithome.com.tw/upload/images/20250903/20168366cAlJ2F73MU.png
    把int32的資料型別轉換成int16
    https://ithelp.ithome.com.tw/upload/images/20250903/20168366RClQcalIe9.png

切片

可通過start:end:step切片方式來方便提取某段數據。
https://ithelp.ithome.com.tw/upload/images/20250903/20168366TXrmjiOtvX.png

由於我只是簡單寫寫切片的作法,想要更詳細的建議直接上網找不用看此篇文張。


上一篇
張量
下一篇
張量合併與分割
系列文
深度學習Tensorflow 2.X9
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言